package com.example.android.utils;

import com.example.android.bean.AddCar;

import java.util.ArrayList;
import java.util.List;

public class ImageUrlUtil {

    public static String getImagesUrl(AddCar addCar) {
        //主图
        List<String> urls = new ArrayList<>();
        urls.add(addCar.getImage1());
        urls.add(addCar.getImage2());
        urls.add(addCar.getImage3());
        urls.add(addCar.getImage4());
        for (String url : urls) {
            if (url != null && !url.equals("")) {
                return url;
            }
        }
        return null;
    }
}
